package com.sina.shop.service.card;

import com.sina.shop.core.BaseService;
import com.sina.shop.core.exception.client.DataException;
import com.sina.shop.core.exception.server.CreateException;
import com.sina.shop.core.exception.server.ResourceExistsException;
import com.sina.shop.core.exception.server.UpdateException;
import com.sina.shop.domain.card.Card;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * 段浩杰   2018-02-06-10:14
 */
public interface CardService extends BaseService {

    //根据用户id得到购物车记录
    List<Card> getCardListByAdminId(Long adminId);

    //删除购物车记录
    int deleteCard(Long id) throws DataException, UpdateException;

    //得到购物记录
    Card getCardById(Long id);

    //保存购物记录
    Card saveCard(Card card) throws CreateException, ResourceExistsException, DataException;

    //更新购物记录
    Card updateCard(Card card) throws UpdateException, DataException;
}
